﻿namespace RecruitmentAgency.Models.DataTypes
{
    /// <summary>
    /// The RecruitmentAgency.Models.Cv.DataTypes.PersonSkill contains the details of a skill that belongs to the user whose ID number is specified with the PersonId property
    /// </summary>
    public class PersonSkill
    {
        /// <summary>
        /// Gets or sets the ID number of the skill record
        /// </summary>
        public int PersonSkillId { get; set; }

        /// <summary>
        /// Gets or sets the ID number of the user that the skill record relates to
        /// </summary>
        public int PersonId { get; set; }

        /// <summary>
        /// Gets or sets the name of the skill
        /// </summary>
        public string SkillName { get; set; }

        /// <summary>
        /// Gets or sets the number of years of experience the user has had with the skill
        /// </summary>
        public string YearsOfExperience { get; set; }

        /// <summary>
        /// Gets or sets the proficiency level the user has mastered the skill to
        /// </summary>
        public string ProficiencyLevel { get; set; }

        /// <summary>
        /// Gets or sets a Boolean value that determines whether the skill record has been verified
        /// </summary>
        public bool SkillVerified { get; set; }

        /// <summary>
        /// Gets or sets the type of verification received for the skill record
        /// </summary>
        public string SkillVerificationType { get; set; }

        /// <summary>
        /// Gets a Boolean value that determines whether the RecruitmentAgency.Models.Cv.DataTypes.PersonSkill is to be considered to be null
        /// </summary>
        public bool IsNull
        {
            get
            {
                return SkillName == null && ProficiencyLevel == null && YearsOfExperience == null;
            }
        }

        /// <summary>
        /// Returns a short summary of the skill record
        /// </summary>
        /// <returns>A short summary of the skill record</returns>
        public string ToShortString()
        {
            return string.Format("{0} at {1} with {2} {3} of experience.", ProficiencyLevel, SkillName, YearsOfExperience, (YearsOfExperience == "1" ? "year" : "years"));
        }
    }
}